#include <iostream>
using namespace std;
struct student{
    string no;
    string name;
    int score1;
    int score2;
    int score3;
    int sum;
};

int main()
{
    int N;
    student students[10] ={{"001","sz",10,20,100,0}};
    cin>>N;
    for(int i = 0; i<N; i++)
    {
        cin>>students[i].no>>students[i].name>>students[i].score1>>students[i].score2>>students[i].score3;
        students[i].sum = students[i].score1 + students[i].score2 + students[i].score3;
    }
    
    student  pMax = students[0];
    for(int i = 1; i<N; i++ )
    {
        if(students[i].sum > pMax.sum)
            pMax = students[i];
    }
     cout<<pMax.name <<" "<<pMax.no << " " <<pMax.sum;

}
